package com.xiaoma.verbal.service;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiaoma.verbal.dao.ServiceApiDao;
import com.xiaoma.verbal.domain.ServiceApi;

@Service
public class ServiceApiService {
	@Autowired
	private ServiceApiDao serviceApiDao;

	public ServiceApi findByUniqueCode(String uniqueCode) {
		ServiceApi api = new ServiceApi();
		api.setUniqueCode(uniqueCode);
		List<?> list = this.serviceApiDao.findByColumns(api);
		if (!CollectionUtils.isEmpty(list)) {
			return (ServiceApi) list.get(0);
		}
		return null;

	}
}
